As the digital imaging technology advances rapidly in recent years, various electronic devices (such as digital cameras, camcorders, notebook computer, and mobile phone, etc) with installed digital imaging components (such as CCD and CMOS, etc) are introduced constantly to the market. Not only the quality becomes higher, but the size or volume of products also becomes less, and thus their price becomes lower gradually. These digital imaging devices available in the market is getting increasingly popular, and many digital imaging devices are equipped with advanced functions such as auto focus and auto exposure. However, image information can be obtained after a whole scene is sensed to determine whether or not to capture the image information, and a face only occupies a small portion of the whole scene, and thus a novice having little experience and skill of properly adjusting the shutter and diaphragm cannot capture satisfactory and praised images. Therefore, finding a way of designing an electronic imaging device with a smart imaging function to meet the photographic requirements of consumers, compensating the consumers' insufficient skills of taking a picture, effectively saving the long adjusting procedure and time, and taking high-quality images becomes an important subject for electronic imaging device designers and manufacturers.
To achieve an electronic imaging device with a smart imaging function and capable of taking high quality images, some manufactures have applied face detection technologies to the new types of electronic imaging devices, wherein the algorithm for detecting a face has been disclosed many publications, and the most popular one is the face detector designed according to a Gentle Adaboost (GAB) algorithm, and the face detector uses a Haar-like feature to identify a face and a specific quantity of face pattern samples to train a required face classifier to determine which image of the scene belongs to (or not belongs) to a face, so as to detect a face in the image and provide a quick identification. Traditionally, the computing rules of the GAB algorithm are listed as follows:
A stage of Haar feature classifier constructionusing GAB1.Start with weights wi = 1/2p and 1/2l where p and l are the number ofpositive and negatives class samples.2.Repeat for m = 1, 2, . . . , M.(a)For each Haar feature j, fm(x) = Pw(y = 1|x) − Pw(y = −1|x)using only the feature j values.(b)Choose the best feature confidence set of values fm(x) giving theminimum weighted error em = Ew [1(yi≠sign[fm(xi)])] for all feature j.(c)Update F(x) ← F(x) + fm(x)(d)Set wi ← wi exp [−yi, fm(xi)], i = 1, 2, . . . , N, and renormalize so that             ∑      i        ⁢                  ⁢          w      i        =  1. 3.Output the classifier sign [F(x)] = sign       [                  ∑                  m          =          1                M            ⁢                          ⁢                        f                      m            ⁢                                                                ⁡                  (          x          )                      ]    .
The GAB algorithm chooses the best Haar feature having the minimum weighted error em from all features. For each weak classifier ƒm(x), the GAB algorithm chooses a feature j, and the error function is minimized by Equation 1:
                                                        f              m                        ⁡                          (              x              )                                =                                                    arg                ⁢                                                                  ⁢                min                            j                        ⁢                          {                                                ∑                  i                                                                                        ⁢                                                      w                    i                                    *                                      v                    i                                                              }                                      ⁢                                  ⁢        where        ⁢                                  ⁢                              v            i                    =                      {                                                                                                      1                      =                                              (                        missclassified                        )                                                                                                                                                        0                      =                      other                                                                                  ,                                                          (        1        )            wi is a sample weight.
Therefore, the foregoing table and Equation 1 show that although the GAB algorithm updates the classifier at each stage by a confidence-rated real value, the misclassification error defined in the GAB algorithm is discrete. In Equation 1, νi is a Boolean variable which is equal to 1 if vi is computed for misclassification, and equal to 0 if νi is computed for classification. As we know that, a weak classifier with a binary output in the discrete Adaboost algorithm cannot show a Haar-like feature being situated at a very good distribution status. Similarly, the misclassification error defined in the algorithm is insufficient to describe the distribution status of the misclassification error precisely.
In view of the description above, the inventor of the present invention redefines the misclassification error em in the GAB algorithm as follows:
                              e          m                =                                                            ∑                i                                                                                  ⁢                                          w                i                            *                              v                i                                              =                                    ∑              i                                                                    ⁢                                          w                i                            *                                                (                                                            y                      i                                        -                                                                  f                        m                                            ⁡                                              (                                                  x                          i                                                )                                                                              )                                2                                                                        (        2        )            
where, νi stands for the distance between a confidence-rated real value and an expected class label. According to an Audio- and Video-based Biometric Person Authentication's paper “Face Detection Using Look-up Table Based Gentle Adaboost” authored by Cem Demirkir and B{umlaut over ( )}ulent Sankur, if ƒm(xi) falls within a variable range of [−1, 1], νi will be a real variable distributed in the variable range of [−2, 2], and such definition can describe a misclassification error in a confidence form and compute the misclassification error by the method of a histogram bin in a computer programming. In two histogram bins as shown in FIG. 1, the two histogram bins show the difference of two defined equations, wherein positive samples in the histogram bins have different distributions for the features i and j. For simplicity the negative samples own sample distribution for feature i and j. If Equation 1 is used, then the resultant error summation will be the same for the two types of feature spaces. If Equation 2 is used, the resultant error summation of the feature will be smaller than the computed result of the feature i. As to a greedy searching scheme, feature j is selected to build the weak classifier according to the definition of a weak classifier function of the weak classifier. If it is difficult to separate the samples in a histogram bin defined in a weak classifier function, the output confidence value will be close to zero, or else the output confidence value will be close to 1 or −1. The result obviously shows that the output confidence value of the feature j is much larger than the output confidence value of the feature i. Thus, in the two histogram bins, the sample in the space of feature j can be separated from the space of feature i more easily, and thus the definition of a confidence-rated misclassification error becomes more reasonable.
Traditionally, the Haar-like feature is defined in its feature pool. Four basic units are used for detecting an object in an image window as shown in FIG. 2, wherein the prototypes 10, 11 represent edge features; the prototype 12 represents a line feature; the prototype 13 represents a special diagonal line feature; the black area represents a negative weight; and the white area represents a positive weight. However, the inventor of the present invention also discloses a way of defining a Haar-like feature according to the foregoing algorithm to separate the samples in the histogram bin more easily, and the Haar-like feature for detecting an object in an image window is defined by eight basic units as shown in FIG. 3 and called as an extended Haar feature, wherein the feature prototypes 20, 21 represent edge features; the black area represents a negative weight; the white area represents a positive weight; and the black and white areas are distributed on the same horizontal line or vertical line and separated with each other by a certain specific distance. The feature prototypes 22, 23 represent diagonal features; the black area represents a negative weight; the white area represents a positive weight; and the diagonals of the black and white areas are perpendicular with each other. The feature prototypes 24, 25 also represent diagonal feature prototypes; the black area represents a negative weight; the white area represents a positive weight; and the diagonals of the black and white areas are parallel with each other. The prototypes 26, 27 represent special diagonal line features; the black area represents a negative weight; and the white area represents a positive weight, wherein ¼ of the areas of the black area and the white area are overlapped along their diagonal directions.
Although the foregoing definition of an extended Haar feature makes the separation of samples in the histogram bin more easily, the inventor of the present invention also finds out that the following situations should be taken into consideration, when a face in a preview image is detected and recognized:
1. To detect a newly present-in unknown face in the current frame and an unknown face not detected in a previous frame, a compete detection process must be conducted for the whole image.
2. The huge quantity of computing values for completing the detection process of the whole image slows down the processing speed significantly.
3. Due to the complexity of a photographed environment for detecting a face in an image by a face detector, the non-face patterns can be rejected accurately.
4. If the factors including pose, expression and illumination are taken into consideration, for the known faces detected in a previous frame, the face detector cannot be too stringent.
Since the forgoing conditions 1 and 2 are contradictive to each other, an image having 120×160 pixels is taken for example. Traditionally, a face detector uses ten different sized searching windows to search every preview image and adjusts the size of the searching windows one by one and moves the searching windows horizontally and vertically to search a face repeatedly, and thus the computing values for such detection process is huge, and the speed and efficiency of the face detection are very low, and the performance cannot meet consumers' requirements and expectations.